/**
 * @author scylla
 * @version V1.0
 * @Project echo-java-base
 * @Title 后台线程池
 * @Description *
 * @Package concurrent.mthread.daemon.executors
 * @Since 2021/7/27 1:55 下午
 */
package concurrent.mthread.daemon.executors;

import concurrent.mthread.daemon.factory.DaemonThreadFactory;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class DaemonThreadPoolExecutor extends ThreadPoolExecutor {


    /**
     * 无参构造
     *
     * @return {@link null}
     * @author chentl
     * @since 1:57 下午 2021/7/27
     **/
    public DaemonThreadPoolExecutor() {
        super(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue<>(), new DaemonThreadFactory());
    }

    /**
     * 含参构造
     *
     * @param corePoolSize    线程池中保留的线程数 如果它们是空闲的，除非设置了 allowCoreThreadTimeOut
     * @param maximumPoolSize 最大线程池容量
     * @param keepAliveTime   线程存活时间
     * @param unit            时间单位
     * @param workQueue       线程池工作队列
     * @return {@link null}
     * @author chentl
     * @since 1:56 下午 2021/7/27
     **/
    public DaemonThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) {
        super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
    }


}
